package main

import (
	"chapter5/src/jwtToken"
	"fmt"
)
/**
 * Created with Goland.
 * User: 令狐飞侠
 * Date: 2021-12-9
 * Description: 测试jwt驱动函数
 */
func main() {
	userName:="令狐飞侠"
	fmt.Println("生成jwt token:")
	signToken,err := jwtToken.GenerateJwtToken(userName)
	if err!=nil{
		fmt.Println("token生成报错:",err)
	}else{
		fmt.Println("token:", signToken)
	}

	fmt.Println("jwt token解析验证:")
	name,err:= jwtToken.ParseJwtToken(signToken)
	if err!=nil{
		fmt.Println("token获取用户报错:",err)
	}else {
		fmt.Println("token中用户:",name)
	}


}
